################################################################################
## @brief
#			email     stanleyguo0207@163.com
#			github    https://github.com/stanleyguo0207
#			gitee     https://gitee.com/stanleyguo0207
#
################################################################################

cmake_minimum_required(VERSION 3.12)

project(test_config CXX)

add_executable(test_config
  ../include.h
  ../main.cpp
  test_config.cpp)
set_target_properties(test_config PROPERTIES
  COMPILE_DEFINITIONS _ASFINGER_TEST_CONFIG="${CMAKE_CURRENT_SOURCE_DIR}/test.conf"
  )
target_link_libraries(test_config
  Catch2::Catch2
  common
  mysql)
include(CTest)
include(ParseAndAddCatchTests)
ParseAndAddCatchTests(test_config)

if(WIN32)
  if(MINGW)
    add_custom_command(TARGET test_config
      POST_BUILD
      COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/test.conf ${CMAKE_BINARY_DIR}/tests/config/
      )
  endif()
endif()